<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .box {
      width: 100px;
      height: 100px;
      background-color: purple;
      animation: go 5s ease 0s infinite;
    }

    @keyframes go {
      0% {
        transform: translate3d(0, 0, 0);
      }

      25% {
        transform: translate3d(800px, 0, 0);
      }

      50% {
        transform: translate3d(800px, 400px, 0)
      }

      75% {
        transform: translate3d(0, 400px, 0);
      }

      100% {
        transform: translate3d(0, 0, 0)
      }
    }
  </style>
</head>

<body>
  <div class="box"></div>
</body>

</html>